/**
*  主线程和worker之间通过任务消息进行交互
*/

typedef struct __st_message {
	int i_message_type;     /* 消息类别 */
	void *p_context;   /* 句柄，根据消息类别确定要转成什么 */
} Message;

typedef struct __st_worker {
	pthread_t thread_id;
	pthread_spinlock_t lock; /* 线程锁，自旋锁 */

	/* 统计信息 */
	struct timeval st_startup_time;
	long long ll_tasks;
	long long ll_time_secs;
	long long ll_errors;
	long long ll_requests;
	long long ll_responses;

	/* 队列相关信息 */	
	list *p_lst_queue; /* Message Queue, FIFO */	
	long l_tasks_todo;
	long l_estimate_secs;
} Worker;

